let jwt = require('jsonwebtoken');
let secret = 'sdgsafsafSDSAF';


function signToken(data) {
  return jwt.sign(data, secret, { expiresIn: 60*60*10 });
}

function verifyToken(token) {
  try {
    return jwt.verify(token, secret)
  } catch (error) {
    // console.log(error);
    return undefined
  }

}

module.exports={
  signToken,
  verifyToken
}

